<?php
/**
 * User: zibuyu
 * Date: 2015/8/4
 * link    http://www.ibuyu.cn
 */
class goodsmodel{
    private static $table='attribute';
    static function getAttribute($model_id){
        $sql='select * from __'.self::$table.' where model_id='.$model_id;
        return db::get_all($sql);
    }
    static function getAttributeOne($id){
        $sql='select * from __'.self::$table.' where id='.$id;
        return db::get_one($sql);
    }
    static function getListModel(){
        $sql='select * from __model';
        return db::get_all($sql);
    }
    static function getSpecList($id=0){
        $sql='select * from __spec';
        if($id){
            $sql.=' where id='.$id;
            return db::get_one($sql);
        }

        return db::get_all($sql);
    }
}